// Package coding_round_1 24-617
// @Title coding_round_1
// @Description  合并两颗二叉树
// @Author  == 琳琳也叫王木木 ==  2021/9/14 11:41
// @Create  2021/9/14 11:41
package coding_round_1

func MergeTrees(t1, t2 *TreeNode) *TreeNode {
	if t1 == nil {
		return t2
	}
	if t2 == nil {
		return t1
	}
	t1.Val += t2.Val
	t1.Left = MergeTrees(t1.Left, t2.Left)
	t1.Right = MergeTrees(t1.Right, t2.Right)
	return t1
}
